<?php 
//CG视频教程 
add_action( 'init', 'create_videocg' );
function create_videocg() {
  $labels = array(
    'name' => _x('CG视频教程', 'post type general name'),
    'singular_name' => _x('CG视频教程', 'post type singular name'),
    'add_new' => _x('添加新教程', 'stories'),
    'add_new_item' => __('添加新视频教程'),
    'edit_item' => __('编辑视频教程'),
    'new_item' => __('新视频教程'),
    'view_item' => __('显示视频教程'),
    'search_items' => __('搜索视频教程'),
    'not_found' =>  __('暂时没有数据'),
    'not_found_in_trash' => __('暂时没有'),
    'parent_item_colon' => ''
  );
 
  $supports = array('title', 'editor', 'thumbnail', 'custom-fields', 'revisions','comments','excerpt');
 
  register_post_type( 'cgvideo',
    array(
      'labels' => $labels,
      'public' => true,
      'supports' => $supports
    )
  );
  	register_taxonomy_for_object_type('post_tag' , 'cgvideo');
   	$labelss = array(			  
  	  'name' => _x( '视频教程分类','iglei'),
  	  'singular_name' => _x( '教程分类','iglei'),
  	  'search_items' =>  __( '搜索教程分类' ),
  	  'all_items' => __( '全部教程分类' ),
  	  'parent_item' => __( 'Parent Set' ),
  	  'parent_item_colon' => __( 'Parent Set:'),
  	  'edit_item' => __( '编辑教程分类' ), 
  	  'update_item' => __( '更新教程分类' ),
  	  'add_new_item' => __( '添加教程分类' ),
  	  'new_item_name' => __( '教程分类名称' ),
  	); 							  
  	
  	register_taxonomy(
		'cgvideoset',
		'cgvideo',
		array(
			'public'=>true,
			'hierarchical' => true,
			'labels'=> $labelss,
			'query_var' => 'cgvideoset',
			'show_ui' => true,
			'rewrite' => array( 'slug' => 'cgvideoset', 'with_front' => false ),
		)
	);	
}


//动画
add_action( 'init', 'create_animation' );
function create_animation() {
  $labels = array(
    'name' => _x('动画', 'post type general name'),
    'singular_name' => _x('动画', 'post type singular name'),
    'add_new' => _x('添加动画', 'stories'),
    'add_new_item' => __('添加新的动画'),
    'edit_item' => __('编辑动画'),
    'new_item' => __('新动画'),
    'view_item' => __('显示动画'),
    'search_items' => __('搜索动画'),
    'not_found' =>  __('暂时没有数据'),
    'not_found_in_trash' => __('暂时没有'),
    'parent_item_colon' => ''
  );
 
  $supports = array('title', 'editor', 'thumbnail', 'custom-fields', 'revisions','comments','excerpt');
 
  register_post_type( 'animation',
    array(
      'labels' => $labels,
      'public' => true,
      'supports' => $supports
    )
  );
  	register_taxonomy_for_object_type('post_tag' , 'animation');
   	$labelss = array(			  
  	  'name' => _x( '动画分类','iglei'),
  	  'singular_name' => _x( '动画分类','iglei'),
  	  'search_items' =>  __( '搜索动画分类' ),
  	  'all_items' => __( '全部动画分类' ),
  	  'parent_item' => __( 'Parent Set' ),
  	  'parent_item_colon' => __( 'Parent Set:'),
  	  'edit_item' => __( '编辑动画分类' ), 
  	  'update_item' => __( '更新动画分类' ),
  	  'add_new_item' => __( '添加动画分类' ),
  	  'new_item_name' => __( '动画名称' ),
  	); 							  
  	
  	register_taxonomy(
		'animationcat',
		'animation',
		array(
			'public'=>true,
			'hierarchical' => true,
			'labels'=> $labelss,
			'query_var' => 'animationcat',
			'show_ui' => true,
			'rewrite' => array( 'slug' => 'animationcat', 'with_front' => false ),
		)
	);	
}



//音乐
add_action( 'init', 'create_music' );
function create_music() {
  $labels = array(
    'name' => _x('音乐', 'post type general name'),
    'singular_name' => _x('音乐', 'post type singular name'),
    'add_new' => _x('添加音乐', 'music'),
    'add_new_item' => __('添加新的音乐'),
    'edit_item' => __('编辑音乐'),
    'new_item' => __('新音乐'),
    'view_item' => __('显示音乐'),
    'search_items' => __('搜索音乐'),
    'not_found' =>  __('暂时没有数据'),
    'not_found_in_trash' => __('暂时没有'),
    'parent_item_colon' => ''
  );
 
  $supports = array('title', 'editor', 'thumbnail', 'custom-fields', 'revisions','comments','excerpt');
 
  register_post_type( 'musics',
    array(
      'labels' => $labels,
      'public' => true,
      'supports' => $supports
    )
  );
  	register_taxonomy_for_object_type('post_tag' , 'musics');
   	$labelss = array(			  
  	  'name' => _x( '音乐分类','iglei'),
  	  'singular_name' => _x( '音乐分类','iglei'),
  	  'search_items' =>  __( '搜索音乐分类' ),
  	  'all_items' => __( '全部音乐分类' ),
  	  'parent_item' => __( 'Parent Set' ),
  	  'parent_item_colon' => __( 'Parent Set:'),
  	  'edit_item' => __( '编辑音乐分类' ), 
  	  'update_item' => __( '更新音乐分类' ),
  	  'add_new_item' => __( '添加音乐分类' ),
  	  'new_item_name' => __( '音乐名称' ),
  	); 							  
  	
  	register_taxonomy(
		'musicscat',
		'musics',
		array(
			'public'=>true,
			'hierarchical' => true,
			'labels'=> $labelss,
			'query_var' => 'musicscat',
			'show_ui' => true,
			'rewrite' => array( 'slug' => 'musicscat', 'with_front' => false ),
		)
	);	
}


//游戏
add_action( 'init', 'create_games' );
function create_games() {
  $labels = array(
    'name' => _x('游戏', 'post type general name'),
    'singular_name' => _x('游戏', 'post type singular name'),
    'add_new' => _x('添加游戏', 'stories'),
    'add_new_item' => __('添加新的游戏'),
    'edit_item' => __('编辑游戏'),
    'new_item' => __('新游戏'),
    'view_item' => __('显示游戏'),
    'search_items' => __('搜索游戏'),
    'not_found' =>  __('暂时没有数据'),
    'not_found_in_trash' => __('暂时没有'),
    'parent_item_colon' => ''
  );
 
  $supports = array('title', 'editor', 'thumbnail', 'custom-fields', 'revisions','comments','excerpt');
 
  register_post_type( 'games',
    array(
      'labels' => $labels,
      'public' => true,
      'supports' => $supports
    )
  );
  	register_taxonomy_for_object_type('post_tag' , 'games');
   	$labelss = array(			  
  	  'name' => _x( '游戏分类','iglei'),
  	  'singular_name' => _x( '游戏分类','iglei'),
  	  'search_items' =>  __( '搜索游戏分类' ),
  	  'all_items' => __( '全部游戏分类' ),
  	  'parent_item' => __( 'Parent Set' ),
  	  'parent_item_colon' => __( 'Parent Set:'),
  	  'edit_item' => __( '编辑游戏分类' ), 
  	  'update_item' => __( '更新游戏分类' ),
  	  'add_new_item' => __( '添加游戏分类' ),
  	  'new_item_name' => __( '游戏名称' ),
  	); 							  
  	
  	register_taxonomy(
		'gamescat',
		'games',
		array(
			'public'=>true,
			'hierarchical' => true,
			'labels'=> $labelss,
			'query_var' => 'gamescat',
			'show_ui' => true,
			'rewrite' => array( 'slug' => 'gamescat', 'with_front' => false ),
		)
	);	
}


//娱乐
add_action( 'init', 'create_recreation' );
function create_recreation() {
  $labels = array(
    'name' => _x('娱乐', 'iglei'),
    'singular_name' => _x('娱乐', 'iglei'),
    'add_new' => _x('添加娱乐', 'iglei'),
    'add_new_item' => __('添加新的娱乐'),
    'edit_item' => __('编辑娱乐'),
    'new_item' => __('新娱乐'),
    'view_item' => __('显示娱乐'),
    'search_items' => __('搜索娱乐'),
    'not_found' =>  __('暂时没有数据'),
    'not_found_in_trash' => __('暂时没有'),
    'parent_item_colon' => ''
  );
 
  $supports = array('title', 'editor', 'thumbnail', 'custom-fields', 'revisions','comments','excerpt');
 
  register_post_type( 'recreation',
    array(
      'labels' => $labels,
      'public' => true,
      'supports' => $supports
    )
  );
  	register_taxonomy_for_object_type('post_tag' , 'recreation');
   	$labelss = array(			  
  	  'name' => _x( '娱乐分类','iglei'),
  	  'singular_name' => _x( '娱乐分类','iglei'),
  	  'search_items' =>  __( '搜索娱乐分类' ),
  	  'all_items' => __( '全部娱乐分类' ),
  	  'parent_item' => __( 'Parent Set' ),
  	  'parent_item_colon' => __( 'Parent Set:'),
  	  'edit_item' => __( '编辑娱乐分类' ), 
  	  'update_item' => __( '更新娱乐分类' ),
  	  'add_new_item' => __( '添加娱乐分类' ),
  	  'new_item_name' => __( '娱乐名称' ),
  	); 							  
  	
  	register_taxonomy(
		'recreationscat',
		'recreation',
		array(
			'public'=>true,
			'hierarchical' => true,
			'labels'=> $labelss,
			'query_var' => 'recreationscat',
			'show_ui' => true,
			'rewrite' => array( 'slug' => 'recreationscat', 'with_front' => false ),
		)
	);	
}


//资讯
add_action( 'init', 'create_news' );
function create_news() {
  $labels = array(
    'name' => _x('资讯', 'post type general name'),
    'singular_name' => _x('资讯', 'advisory'),
    'add_new' => _x('添加资讯', 'advisory'),
    'add_new_item' => __('添加新的资讯'),
    'edit_item' => __('编辑资讯'),
    'new_item' => __('新资讯'),
    'view_item' => __('显示资讯'),
    'search_items' => __('搜索资讯'),
    'not_found' =>  __('暂时没有数据'),
    'not_found_in_trash' => __('暂时没有'),
    'parent_item_colon' => ''
  );
 
  $supports = array('title', 'editor', 'thumbnail', 'custom-fields', 'revisions','comments','excerpt');
 
  register_post_type( 'advisory',
    array(
      'labels' => $labels,
      'public' => true,
      'supports' => $supports
    )
  );
  	register_taxonomy_for_object_type('post_tag' , 'advisory');
   	$labelss = array(			  
  	  'name' => _x( '资讯分类','iglei'),
  	  'singular_name' => _x( '资讯分类','iglei'),
  	  'search_items' =>  __( '搜索资讯分类' ),
  	  'all_items' => __( '全部资讯分类' ),
  	  'parent_item' => __( 'Parent Set' ),
  	  'parent_item_colon' => __( 'Parent Set:'),
  	  'edit_item' => __( '编辑资讯分类' ), 
  	  'update_item' => __( '更新资讯分类' ),
  	  'add_new_item' => __( '添加资讯分类' ),
  	  'new_item_name' => __( '资讯名称' ),
  	); 							  
  	
  	register_taxonomy(
		'advisorycat',
		'advisory',
		array(
			'public'=>true,
			'hierarchical' => true,
			'labels'=> $labelss,
			'query_var' => 'advisorycat',
			'show_ui' => true,
			'rewrite' => array( 'slug' => 'advisorycat', 'with_front' => false ),
		)
	);	
}


//专题
add_action( 'init', 'create_special' );
function create_special() {
  $labels = array(
    'name' => _x('专题', 'specialt'),
    'singular_name' => _x('专题', 'specialt'),
    'add_new' => _x('添加专题', 'specialt'),
    'add_new_item' => __('添加新的专题'),
    'edit_item' => __('编辑专题'),
    'new_item' => __('新专题'),
    'view_item' => __('显示专题'),
    'search_items' => __('搜索专题'),
    'not_found' =>  __('暂时没有数据'),
    'not_found_in_trash' => __('暂时没有'),
    'parent_item_colon' => ''
  );
 
  $supports = array('title',  'thumbnail', 'custom-fields', 'revisions','comments','excerpt');
 
  register_post_type( 'specialt',
    array(
      'labels' => $labels,
      'public' => true,
      'supports' => $supports
    )
  );
  
   	$labelss = array(			  
  	  'name' => _x( '专题分类','iglei'),
  	  'singular_name' => _x( '专题分类','iglei'),
  	  'search_items' =>  __( '搜索专题分类' ),
  	  'all_items' => __( '全部专题分类' ),
  	  'parent_item' => __( 'Parent Set' ),
  	  'parent_item_colon' => __( 'Parent Set:'),
  	  'edit_item' => __( '编辑专题分类' ), 
  	  'update_item' => __( '更新专题分类' ),
  	  'add_new_item' => __( '添加专题分类' ),
  	  'new_item_name' => __( '专题名称' ),
  	); 							  
  	
  	register_taxonomy(
		'specialtcat',
		'specialt',
		array(
			'public'=>true,
			'hierarchical' => true,
			'labels'=> $labelss,
			'query_var' => 'specialtcat',
			'show_ui' => true,
			'rewrite' => array( 'slug' => 'specialtcat', 'with_front' => false ),
		)
	);	

}

/*****widget****/
function iglei_widgets_init() {
	// Area 1, located at the top of the sidebar.
	register_sidebar( array(
		'name' => __( '首页侧边栏', 'iglei' ),
		'id' => 'id-1',
		'description' => __( '这个是首页侧边栏', 'iglei' ),
		'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
		'after_widget' => '</li>',
		'before_title' => '<h3 class="widget-title">',
		'after_title' => '</h3>',
	) );

	// Area 2, located below the Primary Widget Area in the sidebar. Empty by default.
	register_sidebar( array(
		'name' => __( '页面侧边栏', 'iglei' ),
		'id' => 'id-2',
		'description' => __( '页面侧边栏', 'iglei' ),
		'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
		'after_widget' => '</li>',
		'before_title' => '<h3 class="widget-title">',
		'after_title' => '</h3>',
	) );

	// Area 3, located in the footer. Empty by default.
	register_sidebar( array(
		'name' => __( '文章侧边栏', 'iglei' ),
		'id' => 'id-3',
		'description' => __( '文章侧边栏', 'iglei' ),
		'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
		'after_widget' => '</li>',
		'before_title' => '<h3 class="widget-title">',
		'after_title' => '</h3>',
	) );

	// Area 4, located in the footer. Empty by default.
	register_sidebar( array(
		'name' => __( '自定义侧边栏', 'twentyten' ),
		'id' => 'id-4',
		'description' => __( '自定义侧边栏', 'twentyten' ),
		'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
		'after_widget' => '</li>',
		'before_title' => '<h3 class="widget-title">',
		'after_title' => '</h3>',
	) );

}
/** Register sidebars by running twentyten_widgets_init() on the widgets_init hook. */
add_action( 'widgets_init', 'iglei_widgets_init' );


?>